package br.com.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.connection.ConnectionFactory;
import br.com.view.FabricaHtml;
import br.com.view.HtmlPadroes;


public class IndexServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    public IndexServlet() {
        super();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		execute(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		execute(request, response);
	}
	protected void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String encoding = request.getCharacterEncoding();
         if ((encoding != null) && (encoding.equalsIgnoreCase("utf-8")))
         {
             response.setContentType("text/html; charset=utf-8");
         }
		PrintWriter out = response.getWriter();
		try {
		
			Connection conn = new  ConnectionFactory().getConnection();
			out.print(HtmlPadroes.IncTopo());
			
			out.print(FabricaHtml.criarDivSemFec("novotopo"));
			out.print(FabricaHtml.criarDivSemFec("menuIni"));
			out.print(HtmlPadroes.menuIniIntern());
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarInputsOcultos("hidden", "eMail", (String) request.getSession().getAttribute("nome_login")));
			out.print(FabricaHtml.criarInputsOcultos("hidden", "Logado"));
			out.print(FabricaHtml.criarDivSemFec("apresentaForm"));
			out.print(FabricaHtml.fechaDiv());
			
			/*out.print(FabricaHtml.criarDivSemFec("","demo",""));
			
			
			
			out.print(FabricaHtml.criarDivSemFec("conteudoTable"));
			out.print(FabricaHtml.criarDivSemFec("tabp", ""));
			out.print(FabricaHtml.criarUlNotClose());
			out.print(FabricaHtml.criarLi(FabricaHtml.criarAcp("#tabs-1", "Resumo Financeiro")));
			out.print(FabricaHtml.criarLi(FabricaHtml.criarAcp("#tabs-2", "Informa&ccedil;&otilde;es Gerais")));
			out.print(FabricaHtml.ulClose());
			out.print(FabricaHtml.criarDivSemFec("tabs-1", ""));
				out.print(FabricaHtml.criarDivSemFec(""));
				out.print(FabricaHtml.criarDivGrafic("containInici", 1050, 320));
				out.print(FabricaHtml.fechaDiv());
				out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("tabs-2", ""));
			out.print(FabricaHtml.criarDivSemFec(""));
			out.print(FabricaHtml.criarDivSemFec("exibyPerf", "exibPerf"));
			out.print(FabricaHtml.criarDiv("perfy","Nome"));
			out.print(FabricaHtml.criarDiv("perfy","E-mail"));
			out.print(FabricaHtml.criarDiv("perfy","CPF/CNPJ"));
			out.print(FabricaHtml.criarDiv("perfy","Fone"));
			out.print(FabricaHtml.criarDiv("perfy","Celular"));
			out.print(FabricaHtml.criarDiv("perfy","Fax"));
			out.print(FabricaHtml.criarDiv("perfy","Sexo"));
			out.print(FabricaHtml.criarDiv("perfy","Data Nascimento"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("exibPerf", "exibPerf"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivGrafic("container", 630, 280));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.fechaDiv());
*/
			//out.print(FabricaHtml.criarDivSemFec("","demo",""));
			out.print(FabricaHtml.criarDivSemFec("dialog-incial", "", "Dados do Perfil"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-responsavel", "responsavel", "Responsavel"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-cliente", "cliente", "Cliente"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-funcionario", "funcionario", "Funcionario"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-veiculo", "veiculo", "Veiculo"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-bairro", "bairro", "bairro"));
			out.print(FabricaHtml.fechaDiv());
			/*	out.print(FabricaHtml.criarDivSemFec("dialog-lancamentoReceber", "", "Depositar"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-lancamentoTransferencia", "", "Trafer&ecirc;ncia"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-FavorEdit", "", "Editar Favorecido"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-RP", "", "Editar Conta"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-ContaBanc", "", "Editar Conta"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-Transferencia", "", "Editar Transfer&ecirc;ncia"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-Lancamento", "", "Editar Lan&ccedil;amento"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-confirm", "", "Excluir Item"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-confirmy", "", "Liquidar Conta"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-PerfilLog", "", "Alterar Perfil"));
			out.print(FabricaHtml.fechaDiv());
			out.print(FabricaHtml.criarDivSemFec("dialog-AlterarLog", "", "Alterar Login"));
			out.print(FabricaHtml.fechaDiv());*/
			//out.print(FabricaHtml.fechaDiv());

			out.print(FabricaHtml.fechaDiv());
			out.print(HtmlPadroes.rodapeSite(""));
		} catch (Exception e) {
			e.printStackTrace();
			out.print(e);
		}
	}

}
